<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心--我的积分</title>
<script src="http://cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>  
</head>

<body>
{include file='Public/login.html'}

<p><a href="{U('UserCenter/member')}">返回</a></p>

<p><img src="{$u_info.avatar}" width="150" height="150"></p>
<p>{$u_info.user_name}</p>
<p>我的积分：{$u_info.user_points}</p>

<!--<p><a href=""><img src="/amall/Public/Home/images/u711.png">扫小票换积分</a></p>-->

<p>积分记录</p>

<table cellspacing="10" cellpadding="10" id="points">
	<tr><th>时间</th><th>积分数</th><th>备注</th></tr>
	{foreach from=$polst item=val}
	<tr><td>{date('Y-m-d H:i:s',$val.log_time)}</td><td>{$val.user_points}</td><td>{$val.log_text}</td></tr>
	{/foreach}
	<tr><td colspan="2">{$page}</td></tr>
</table>

<div id="more" style="display: none;"><a href="javascript:;" id="climore">加载更多</a></div>

<a href='{U("UserCenter/goto_use?uid={$val.ucrd_id}")}'>{$val.card_name}</a>
<script type="text/javascript">

var ys = 2;//从第二页开始获取数据
$("#climore").click(function(){
		$.ajax({  
		    url: '../UserCenter/more_points/page/'+ys,//提交访问的URL,地址后缀不要加html  
		    type:'GET',  
		    dataType:'text',  
		    async:false,
		    timeout:1000,  
		    error:function(){  
		        alert('操作频繁，请稍后再试！');  
		    },  
		    success:function(data){  
		        //console.log(data);
		        var str = "";//定义变量保存内容
		        var returnData = eval(data);//将字符串转换成对象 
				$.each(returnData,function(index,val)
				{
					if(val.log_id)
					{
						//str += '<li>'+val.user_points+'</li>';
						var log_time = formatDateTime(val.log_time);
						str += '<tr><td>'+log_time+'</td><td>'+val.user_points+'</td><td>'+val.log_text+'</td></tr>';
					}
					else
					{
						$("#more").html("没有更多内容了..");
					}
				}); 
				$("#points").append(str); //把HTML添加到容器
				ys++;//页数+1
		    }  
		});
	});

</script>
</body>
</html>